<template>
  <div class="home">
    <el-container>
      <el-header class="header">
        <button @click="isCollapse = !isCollapse">展开/收起</button>
      </el-header>
      <el-container>
        <el-aside style="width: auto">
          <el-menu
            :collapse="isCollapse"
            default-active="2"
            router
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>导航一</span>
            </template>

            <el-submenu index="1">
              <template slot="title"
                ><i class="el-icon-location"></i>
                <span>留言管理</span></template
              >
              <el-menu-item index="/home/add">
                <i class="el-icon-location"></i>
                <span>添加留言</span>
              </el-menu-item>
              <el-menu-item index="/home/message">
                <i class="el-icon-location"></i>
                <span>留言看板</span>
              </el-menu-item>
            </el-submenu>

            <el-menu-item index="/home/user">
              <i class="el-icon-menu"></i>
              <span slot="title">用户管理</span>
            </el-menu-item>

           
          </el-menu>
        </el-aside>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: "HomeView",
  components: {},
  data() {
    return {
      isCollapse: false,
    };
  },
};
</script>
<style scoped>
.home {
  width: 100vw;
  height: 100vh;
  display: flex;
}
.header {
  background-color: antiquewhite;
}
.el-main {
  background-color: azure;
}
.el-aside {
  background-color: black;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
</style>